package com.Sep_Twenty_Nine;

/**
 * 面试题 01.09. 字符串轮转
 *字符串轮转。给定两个字符串s1和s2，请编写代码检查s2是否为s1旋转而成（比如，waterbottle是erbottlewat旋转后的字符串）。
 * https://leetcode.cn/problems/string-rotation-lcci/
 *
 * 2022/09/29 13:13
 */

public class Solution01_09 {

    public boolean isFlipedString(String s1, String s2) {
        if (s1.length()!=s2.length()) return false;
        int n=s1.length();
        String ss=s2+s2;
        return ss.contains(s1);
    }

    public static void main(String[] args) {
        Solution01_09 solution01_09=new Solution01_09();
        System.out.println(solution01_09.isFlipedString("waterbottle","erbottlewat"));
    }
}
